package com.atguigu.hellomp;

import com.atguigu.hellomp.entity.User;
import com.atguigu.hellomp.mapper.UserMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

/**
 * @author 张智勇
 * @date 2025年08月13日 20:04
 */


@SpringBootTest
public class testPage {

    @Autowired
    UserMapper userMapper;

    @Test
    public void a(){

        Page<User> userPage = new Page<>(2,2);

        Page<User> userPageRsult = userMapper.selectPage(userPage, null);

        long pages = userPageRsult.getPages();
        List<User> records = userPageRsult.getRecords();
        long total = userPageRsult.getTotal();

        System.out.println(pages);
        System.out.println(records);
        System.out.println(total);


    }






}
